package pers.huangyuhui.sms.mapper;

import org.apache.ibatis.annotations.Param;
import pers.huangyuhui.sms.model.TeacherInfo;

import java.util.List;
import java.util.Map;

public interface TeacherMapper {

    /**
     * @param name 教师姓名
     * @param password 密码
     * @return {@code teacherInfo}类型的数据
     */
    TeacherInfo getUserInfo (@Param("name") String name , @Param("password") String password);

    /**
     * @param teacherInfo 教师信息
     * @return {@code boolean}类型,添加成功后返回{@code true},否则返回{@code false}
     */
    boolean addTeacher ( TeacherInfo teacherInfo );

    /**
     * @param map 该哈希表中应含有分页信息{@code paging.start},{@code paging.size}以及教师信息{@code teacherInfo.id},{@code teacherInfo.classId},{@code teacherInfo.name}
     * @return {@code boolean}类型,添加成功后返回{@code true},否则返回{@code false}
     */
    List<TeacherInfo> getTeacherList ( Map<String , Object> map );

    /**
     * @param teacherInfo 教师信息
     * @return {@code Integer}类型的列表总长
     */
    Integer getTeacherListNum ( TeacherInfo teacherInfo );

    /**
     * @param teacherInfo 教师信息
     * @return {@code boolean}类型,修改成功后返回{@code true},否则返回{@code false}
     */
    boolean editTeacherInfo ( TeacherInfo teacherInfo );

    /**
     * @param ids 由将被删除的教师{@code id}组成的数组
     * @return {@code boolean}类型,删除成功后返回{@code true},否则返回{@code false}
     */
    boolean deleteTeacher ( String[] ids );

    /**
     * @param map 该哈希表中应含有{@code teacherInfo}类型的教师信息,以及新设定的密码{@code newPassword}
     * @return {@code boolean}类型,修改成功后返回{@code true},否则返回{@code false}
     */
    boolean modifyPassword ( Map<String , Object> map );
}
